import request from '@/utils/request'

export default {
  tree(params) {
    return request({
      url: '/admin/equipment/tree',
      method: 'get',
      params
    })
  },
  eqList(params) {
    return request({
      url: '/v1/eqList/1',
      method: 'get',
      params
    })
  },
  equipmentList(params) {
    return request({
      url: '/v1/equipmentList',
      method: 'get',
      params
    })
  },
  getOne(id) {
    return request({
      url: `/v1/equipment/${id}`,
      method: 'get'
    })
  },
  create(data) {
    return request({
      url: '/v1/eqAdd',
      method: 'post',
      data
    })
  },
  update(data) {
    return request({
      url: '/v1/eqUpdate',
      method: 'post',
      data
    })
  },
  delete(id) {
    return request({
      url: `/v1/eqDel/${id}`,
      method: 'get'
    })
  },
  categoryTree() {
    return request({
      url: '/v1/categoryTree',
      method: 'get'
    })
  },
  positionTree() {
    return request({
      url: '/v1/positionTree',
      method: 'get'
    })
  },
  excel(data) {
    return request({
      url: '/v1/eqExcel',
      method: 'post',
      data
    })
  },
  append(data) {
    return request({
      url: '/v1/eqAdminAppend',
      method: 'post',
      data
    })
  },
  remove(data) {
    return request({
      url: '/v1/eqAdminRemove',
      method: 'post',
      data
    })
  },
  appendPlanAdmin(data) {
    return request({
      url: '/v1/eqPlanAdminSave',
      method: 'post',
      data
    })
  },
  removePlanAdmin(data) {
    return request({
      url: '/v1/eqPlanAdminDel',
      method: 'post',
      data
    })
  },
  appendEngineer(data) {
    return request({
      url: '/v1/appendEngineer',
      method: 'post',
      data
    })
  },
  removeEngineer(data) {
    return request({
      url: '/v1/removeEngineer',
      method: 'post',
      data
    })
  }
}
